< Prev(J) / Next(K) > / View :

Filename: /text/scalc/guide/cellstyle_by_formula.xhp

(bookmark: bm_id3145673)
formats; assigning by formulas
cell formats; assigning by formulas
STYLE function example
cell styles;assigning by formulas
formulas;assigning cell formats

書式; 数式を使って割り当てる
セルの書式; 数式を使って割り当てる
STYLE 関数の例
セルスタイル; 数式を使って割り当てる
数式; セルの書式を割り当てる

(variable: cellstyle_by_formula)Assigning Formats by Formula
(variable: cellstyle_by_formula)数式を使って書式を割り当てる (hd_id3145673.13)

The STYLE() function can be added to an existing formula in a cell. For example, together with the CURRENT function, you can color a cell depending on its value. The formula =...+STYLE(IF(CURRENT()>3; "Red"; "Green")) applies the cell style "Red" to cells if the value is greater than 3, otherwise the cell style "Green" is applied.
STYLE() 関数は、セル内の既存の数式に追加することができます。 たとえば、CURRENT 関数と共に使用し、入っている値にもとづいてセルに色を付けることができます。 数式 =...+STYLE(IF(CURRENT()>3; "Red"; "Green")) は、値が 3 を超える場合はセルのスタイルとして "Red (赤)" を、値が 3 を超えない場合はセルスタイル "Green (緑)" をセルに適用することを意味します。(par_id3150275.14)

If you would like to apply a formula to all cells in a selected area, you can use the Find & Replace dialog.
選択したセル範囲のすべてのセルに数式を適用するには、ダイアログ 検索と置換 を使用します。(par_id3151385.15)

  1. Select all the desired cells.
    該当するセルを全て選択します。(par_id3149456.16)

  2. Select the menu command Edit - Find & Replace.
    メニューから編集 → 検索と置換 を選択します。(par_id3148797.17)

  3. For the Search for term, enter: .*
    用語の検索を入力してください: .*(par_id3150767.18)

    ".*" is a regular expression that designates the contents of the current cell.
    「.*」は、現在のセルの内容すべてを示す正規表現です。(par_id3153770.19)

  4. Enter the following formula in the Replace with field: =&+STYLE(IF(CURRENT()>3;"Red";"Green"))
    置換フィールドに次の数式を入力してください。=&+STYLE(IF(CURRENT()>3;"Red";"Green"))(par_id3153143.20)

    The "&" symbol designates the current contents of the Search for field. The line must begin with an equal sign, since it is a formula. It is assumed that the cell styles "Red" and "Green" already exist.
    記号「&」は、検索テキスト の現在の内容を示す正規表現です。行は数式であるため、イコール記号で始まる必要があります。ここては、「赤」と「緑」という名前のセルスタイルがすでに存在すると仮定します。(par_id3146975.21)

  5. Mark the fields Regular expressions and Current selection only. Click Find All.
    正規表現選択範囲のみ をオンにします。すべて検索 をクリックします。(par_id3149262.22)

    All cells with contents that were included in the selection are now highlighted.
    選択範囲内で内容が入力されているセルは、反転表示されます。(par_id3144767.24)

  6. Click Replace all.
    全て置換をクリック。(par_id3147127.23)

(embed text/scalc/guide/cellstyle_conditional.xhp#cellstyle_conditional : linkinfo)

Applying Conditional Formatting
条件付き書式設定を使う(hd_id3149263.24)

(/embed text/scalc/guide/cellstyle_conditional.xhp#cellstyle_conditional)

(embed text/scalc/guide/cellstyle_minusvalue.xhp#cellstyle_minusvalue : linkinfo)

Highlighting Negative Numbers
マイナス値を強調表示する(hd_id3147434.31)

(/embed text/scalc/guide/cellstyle_minusvalue.xhp#cellstyle_minusvalue)


< Prev / Next >